// ============================================================================
//  gDestroyer.uc ::
// ============================================================================
class gDestroyer extends gWeapon;

var() gDestroyerBeamInfo Beam;

simulated function Tick(float dt)
{
    if(!HasAmmo())
	{
	    tfpri(TFPawn(owner).playerreplicationinfo).usedcredits -=1000;
        DetachFromPawn(instigator);
        Instigator.DeleteInventory(self);
        instigator.controller.SwitchToBestWeapon();
        Destroy();
    }
}

function BeamBegin()
{
    if( Role == ROLE_Authority )
    {
        if( Beam != None )
        {
            //gLog("ERROR: Beam in BeamBegin()");
            BeamEnd();
        }

        Beam = Spawn(class'gDestroyerBeamInfo',Instigator, , GetBoneCoords('muzzle').Origin);

        ThirdPersonActor.AmbientSound = gWeaponFire(FireMode[1]).FireLoopSound;
    }
}

function BeamEnd()
{
    if( Role == ROLE_Authority )
    {
        if( Beam != None )
        {
            Beam.Release();
        }

        Beam = None;
    }
    ThirdPersonActor.AmbientSound = None;
    FireMode[1].PlayFireEnd();
}




// ============================================================================
//  DefaultProperties
// ============================================================================

defaultproperties
{
     ItemSize=4
     CostWeapon=1200.000000
     CostAmmo=300.000000
     FireModeClass(0)=Class'Taskforces.gDestroyerFire'
     FireModeClass(1)=Class'Taskforces.gDestroyerFireAlt'
     SelectSound=SoundGroup'TFMedia.selection.grp_select_big'
     AIRating=0.780000
     CurrentRating=0.780000
     Description="A fire/lava-based burnination machine that makes the BFG reach for a fresh pair of underwear."
     DisplayFOV=80.000000
     HudColor=(B=0,G=0)
     SmallViewOffset=(X=47.000000,Y=22.000000,Z=-35.000000)
     CenteredOffsetY=-5.000000
     CenteredYaw=-500
     PickupClass=Class'Taskforces.gDestroyerPickup'
     PlayerViewOffset=(X=55.000000,Y=25.000000,Z=-33.000000)
     AttachmentClass=Class'Taskforces.gDestroyerAttachment'
     IconCoords=(X1=510,X2=765,Y2=63)
     ItemName="Multon Destroyer"
     Mesh=SkeletalMesh'TFFireGunA.FireGun'
     SoundRadius=256.000000
     bDoAmmoRegen=False
     StationDmgModifier=4
     InventoryGroup=0
     GroupOffset=7
     SkillCost=1000
}
